package com.ruicar.afs.cloud.archive.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.archive.dto.MortgageDto;
import com.ruicar.afs.cloud.archive.result.ArchivedResultDto;
import com.ruicar.afs.cloud.common.core.feign.AfsFeignFormSupport;
import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * @description: 解抵押
 * @author: sijun.yu
 * @date: 2020/6/11 17:42
 */
@FeignClient(name = "mortgage", url = "${com.greatwall.systems.archive-system.url}", configuration = AfsFeignFormSupport.class)
public interface MortgageApiFeign {

    /**
     * 解抵押-解抵押列表查询
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("解抵押-解抵押列表查询")
    @PostMapping(value = "/S22001/mortgage/getlist")
    @AfsFeignClear(true)
    ArchivedResultDto getMortgageList(@RequestBody MortgageDto dto, @RequestHeader Map<String, String> headers);


    /**
     * 解抵押-解抵押列表模糊查询
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("解抵押-解抵押列表模糊查询")
    @PostMapping(value = "/S22001/mortgage/matching")
    @AfsFeignClear(true)
    ArchivedResultDto matching(@RequestBody MortgageDto dto, @RequestHeader Map<String, String> headers);


    /**
     * 解抵押-解抵押确认
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("解抵押-解抵押确认")
    @PostMapping(value = "/S22001/mortgage/sure")
    @AfsFeignClear(true)
    ArchivedResultDto sure(@RequestBody MortgageDto dto, @RequestHeader Map<String, String> headers);

    /**
     * 根据合同id获取解抵押信息
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("根据合同id获取解抵押信息")
    @PostMapping(value = "/S22001/mortgage/get")
    @AfsFeignClear(true)
    ArchivedResultDto get(@RequestBody MortgageDto dto, @RequestHeader Map<String, String> headers);


    /**
     * 解抵押-解抵押列表查询-资产修正
     *
     * @param dto
     * @param headers
     * @return
     */
    @ApiOperation("解抵押-解抵押列表查询")
    @PostMapping(value = "/S22001/aftermortgage/getlist")
    @AfsFeignClear(true)
    JSONObject getAftermortgageList(@RequestBody MortgageDto dto, @RequestHeader Map<String, String> headers);
}
